CREATE TABLE [dbo].[Grup]
(
[Ik_grup] [int] NOT NULL IDENTITY(1, 1),
[ik_spec_fac] [int] NOT NULL,
[Cname_grup] [varchar] (50) COLLATE Cyrillic_General_CI_AS NOT NULL,
[Ik_uch_plan] [int] NULL,
[nYear_post] [int] NULL,
[DateCreate] [datetime] NULL,
[DateExit] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Grup] ADD CONSTRAINT [CheckGrupnYear_post] CHECK (([nYear_post]>=(1990) AND [nYear_post]<(datepart(year,getdate())+(1))))
GO
ALTER TABLE [dbo].[Grup] ADD CONSTRAINT [PK_Grup] PRIMARY KEY CLUSTERED  ([Ik_grup]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Grup] ADD CONSTRAINT [IX_Grup] UNIQUE NONCLUSTERED  ([Cname_grup]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Grup] WITH NOCHECK ADD CONSTRAINT [FK_Grup_Relation_spec_fac] FOREIGN KEY ([ik_spec_fac]) REFERENCES [dbo].[Relation_spec_fac] ([ik_spec_fac])
GO
ALTER TABLE [dbo].[Grup] WITH NOCHECK ADD CONSTRAINT [FK_Grup_Uch_pl] FOREIGN KEY ([Ik_uch_plan]) REFERENCES [dbo].[Uch_pl] ([ik_uch_plan])
GO
